<template>
  <div>
    <div class="w">
      <Breadcrumb :breadcrumbs="breadcrumbs"/>
      <components :is="componentsName" class="payhistory-content"/>
    </div>
  </div>
</template>
<script>

import Breadcrumb from '@/components/Breadcrumb';
import { mapGetters } from 'vuex';
import btc from './components/btc';
import dcr from './components/dcr';
import bch from './components/bch';

export default {
  name: 'PayHistory',
  components: {
    Breadcrumb,
    btc,
    dcr,
    bch,
  },
  data() {
    return {
      breadcrumbs: [{
        path: '/',
        titleKey: 'header.nav.home',
      }, {
        path: '/pools/payhistory',
        titleKey: 'router.payhistory',
      }],
    };
  },
  computed: {
    ...mapGetters(['subCoinType']),
    componentsName() {
      if (this.subCoinType === 'bsv') {
        return 'bch';
      } else if (this.subCoinType === 'zec') {
        return 'dcr';
      }
      return this.subCoinType;
    },
  },
};
</script>
<style lang="scss" scoped>
.payhistory-content{
  /deep/ section{
    background-color: #ffffff;
    border-radius: 5px;
    border: solid 1px #e0e0e0;
    position: relative;
    overflow: hidden;
    .header{
      height: 50px;
      background-color: #f9f9f9;
      box-shadow: inset 0px -1px 0px 0px #f2f2f2;
      padding: 0 20px;
      display: flex;
      justify-content: space-between;
      .area{
        height: 30px;
        line-height: 28px;
        font-size: 12px;
        color: #333;
        margin-top: 10px;
      }
      .excel{
        width: 90px;
        height: 30px;
        line-height: 30px;
        background-color: #ffffff;
        border-radius: 3px;
        border: solid 1px #cccccc;
        font-size: 12px;
        color: #333333;
        cursor: pointer;
        text-align: center;
        margin-top: 10px;
      }
    }
    table{
      width: 100%;
      tr{
        border-top: 1px solid #eaeaea;
        &:nth-of-type(even){
          background-color: #fbfbfb;
        }
        th{
          height: 30px;
          color: #ccc;
          font-weight: normal;
          i{
            margin-left: 6px;
            font-weight: bold;
          }
        }
        td{
          height: 60px;
          color: #333;
          &.status{
            &.active{
              color: #70c1b3;
            }
            &.inactive{
              color: #eb547c;
            }
            &.dead{
              color: #ccc;
            }
          }
          .text-truncate{
            max-width: 280px;
            display: inline-block;
          }
        }
        th, td{
          font-size: 12px;
          white-space: nowrap;
          text-align: center;
          border: none;
          .todetail{
            color: #247ba0;
          }
        }
      }
    }
  }
}
</style>
